/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021.
 * Description: rtos ulimit header
 * Author: Songtang Liu
 * Create: 2021-09-11
 */

#ifndef RTOS_ULIMIT_H_
#define RTOS_ULIMIT_H_
#include <linux/signal.h>
#include <linux/sched/signal.h>

#if defined(CONFIG_RTOS_ULIMIT_VM_SIG) || defined(CONFIG_RTOS_ULIMIT_VM_SIG_MODULE)

#define SIGNAL_VM_EXCEED	(SIGRTMIN + 15)

extern unsigned long vm_expand_signal_enable;

static inline void vm_expand_send_signal(void)
{
	if (vm_expand_signal_enable)
		send_sig(SIGNAL_VM_EXCEED, current, 1);
}
#else
static inline void vm_expand_send_signal(void) {}
#endif

#endif
